import http from './../../../base/api/public'
let sysConfig = require('@/../config/sysConfig')
let apiUrl = sysConfig.sfsApiUrlPre;
import querystring from 'querystring'

/*选课查询*/
export const course_list = (page,size,params) => {
  return http.requestPost(apiUrl+'/learning/choosecourse/list/'+page+'/'+size,params);
};

/*查询选课状态*/
export const course_learnstatus = courseId => {
  return http.requestPost(apiUrl+'/learning/choosecourse/learnstatus/'+courseId);
};



//获取课程播放地址
export const get_media = (courseId,chapter) => {
  return http.requestGet(apiUrl+'/learning/course/getmedia/'+courseId+'/'+chapter);
};

//添加学习记录
export const add_learning = (userId,courseId,teachplanId)=>{
  return http.requestPost(apiUrl+'/learning/course/addlearning/'+userId+'/'+courseId+'/'+teachplanId);
};

//获取用户记录
export const get_learning=(userId)=>{
  return http.requestGet(apiUrl+'/learning/course/getlearning/'+userId);
};

//收藏课程
export const collect_course=(userId,courseId)=>{
  return http.requestPost(apiUrl+'/learning/course/collect/'+userId+'/'+courseId)
};


